# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# List of all connectivity libraries available.
add_library(mbed-802.15.4-rf INTERFACE)
add_library(mbed-ble INTERFACE)
add_library(mbed-ble-cordio INTERFACE)
add_library(mbed-ble-cordio_ll INTERFACE)
add_library(mbed-cellular INTERFACE)
add_library(mbed-coap INTERFACE)
add_library(mbed-emac INTERFACE)
add_library(mbed-lorawan INTERFACE)
add_library(mbed-lwipstack INTERFACE)
add_library(mbed-mbedtls INTERFACE)
add_library(mbed-nanostack INTERFACE)
add_library(mbed-nanostack-coap_service INTERFACE)
add_library(mbed-nanostack-mbed_mesh_api INTERFACE)
add_library(mbed-nanostack-hal_mbed_cmsis_rtos INTERFACE)
add_library(mbed-nanostack-sal_stack INTERFACE)
add_library(mbed-nanostack-sal_stack-event_loop INTERFACE)
add_library(mbed-nanostack-libservice INTERFACE)
add_library(mbed-netsocket INTERFACE)
add_library(mbed-nfc INTERFACE)
add_library(mbed-ppp INTERFACE)
add_library(mbed-wifi INTERFACE)

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
    # Add these subdirectories for tests
    add_subdirectory(cellular)
    add_subdirectory(drivers)
    add_subdirectory(FEATURE_BLE)
    add_subdirectory(libraries)
    add_subdirectory(lorawan)
    add_subdirectory(mbedtls)
    add_subdirectory(netsocket)
    add_subdirectory(nfc)
else()
    # The directories below contain optional target libraries
    add_subdirectory(FEATURE_BLE EXCLUDE_FROM_ALL)
    add_subdirectory(cellular EXCLUDE_FROM_ALL)
    add_subdirectory(drivers EXCLUDE_FROM_ALL)
    add_subdirectory(libraries EXCLUDE_FROM_ALL)
    add_subdirectory(lorawan EXCLUDE_FROM_ALL)
    add_subdirectory(lwipstack EXCLUDE_FROM_ALL)
    add_subdirectory(mbedtls EXCLUDE_FROM_ALL)
    add_subdirectory(nanostack EXCLUDE_FROM_ALL)
    add_subdirectory(netsocket EXCLUDE_FROM_ALL)
    add_subdirectory(nfc EXCLUDE_FROM_ALL)
endif()
